class AliPay:

    def pay(self):
        print('通过支付宝消费')

class WeChatPay:

    def pay(self):
        print('通过微信消费')

class Order(object):

    def account(self,pay_obj):
        pay_obj.pay()

order = Order()
a = AliPay()
w = WeChatPay()
order.account(w)
order.account(a)